#!/usr/bin/env python

#*************************************************************
# Top-level script for running a WRF forecast and all of 
# the pre-processsing, post-processing, visualization
# and verification which goes with it.
#
# This can be run as a command-line script where the first
# and only argument is a configuration file which sets most 
# of the options.
#
# All of the heavy lifting is done in the wrftools
# module. This script this ties it all together, initialises 
# the logging framework and does some basic error checking
#
# The philosophy is to have output grib files archived by initial 
# time, so that subsequent visualisation and verification can 
# be done using the same outer-loop as this script. Another design
# choice is to use a configuration file with the same (at least similar)
# syntax to the namelist.wps and namelist.input files used by WRF
# so that the same code can be re-used reading these.
#
# TODO: tidy up logging statements so they are consistent
#       add visualisation codes
#       add performance/timing code
#
# AUTHOR: sam.hawkins@vattenfall.com
#**************************************************************

USAGE = """python sync_namelists namelist.wps namelist.input """

import sys
from wrftools import wrftools
args = sys.argv[1:]
if len(args)!=2:
    print USAGE
    sys.exit(1)



wrftools.sync_namelists(args[0], args[1])


